import request from '@/utils/request'

export function getRolesList(params) {
  return request({
    url: '/api/sys/role',
    method: 'get',
    params
  })
}
export function delRole(id) {
  return request({
    // url: `api/sys/role/${id}`,
    url: '/api/sys/role/' + id,
    method: 'delete'
  })
}
// 添加角色
export function addRole(data) {
  return request({
    url: '/api/sys/role',
    method: 'post',
    data
  })
}

export function editRole(data) {
  return request({
    url: `api/sys/role/${data.id}`,
    method: 'put',
    data
  })
}

export function getRoles(params) {
  return request({
    url: 'api/sys/role',
    method: 'GET',
    params
  })
}
